home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Presentations / Presentations ’97 / Sessions ’97 / Multiplatform Code⁄Data Sharing / HelloBothWorlds / Shared / DemoConversions.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-26  |  978 b   |  64 lines  |  [TEXT/CWIE]

  1. /*
  2.     DemoConversions.h
  3.     
  4.     Application-level format conversions used in MacHack demo
  5.     
  6.     Al Evans
  7.     
  8.     6/13/97
  9.     
  10. */
  11.  
  12.  
  13. #ifndef DEMOCONVERSIONS
  14. #define DEMOCONVERSIONS
  15.  
  16. #include "common.h"
  17.  
  18. struct Point16
  19. {
  20.     int16 v, h;
  21.     operator const Point () const;
  22.     Point16& operator = ( const Point& p );
  23. };
  24.  
  25. assert_anywhere( sizeof (Point16) == 4 );
  26.  
  27. void SwapIfRequired( Point16* p);
  28.  
  29. struct Rect16
  30. {
  31.     int16 top, left, bottom, right;
  32.     operator const Rect () const;
  33.     Rect16& operator = ( const Rect& r );
  34. };
  35.  
  36. assert_anywhere( sizeof (Rect16) == 8 );
  37.  
  38. void SwapIfRequired( Rect16* r);
  39.  
  40.  
  41. // Format of view layout resource
  42.  
  43. typedef struct ViewLayout {
  44.     Rect16    viewSize;
  45.     int32    viewCTabID;
  46.     int32    viewBkgID;
  47.     int32    viewBouncerID;
  48.     int32    viewBtnID;
  49. } ViewLayout;
  50.  
  51. void SwapIfRequired(ViewLayout* view);
  52.  
  53. // Format of button description resource
  54.  
  55. typedef struct ButtonSpec {
  56.     int32    btnPicResNum;
  57.     int32    btnURLResNum;
  58.     Point16    btnTopLeft;
  59. } ButtonSpec;
  60.  
  61. void SwapIfRequired(ButtonSpec* button);
  62.  
  63. #endif
  64.